//
//  ViewController.m
//  ArrayRemoveDuplication
//
//  Created by DeLongYang on 2018/1/19.
//  Copyright © 2018年 DeLongYang. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self testOne];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)testOne{
    
    NSArray *arr = @[@0,@1,@1,@2,@3,@3,@4,@5,@6,@8,@8,@8,@8,@9,@10];
    NSMutableArray *uniqueArray = [NSMutableArray array];
    NSUInteger arrCount = arr.count;
    for (int i =0; i<arrCount; i++) {
        
        NSNumber *value = arr[i];
        BOOL iElementUnique = true;
        if (uniqueArray.count<1) {
            [uniqueArray addObject:value];
        }else{
            NSUInteger uniqueArrayCount = uniqueArray.count;
            for (int j = 0; j<uniqueArrayCount; j++) {
                NSNumber *valueJ = uniqueArray[j];
                if (valueJ.intValue == value.intValue) {
                    iElementUnique = false;
                }
            }
            if (iElementUnique == true) {
                [uniqueArray addObject:value];
            }
        }
    }
    NSLog(@"unique queue is %@",uniqueArray);
}



@end
